package br.com.jvet.entidade;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name = "tbtipoexame")
@SequenceGenerator(name = "tipoexame_seq", sequenceName = "tipoexame_seq", initialValue = 1, allocationSize = 1)
public class TipoExame implements Serializable {

	private static final long serialVersionUID = 2342357576968497715L;
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "tipoexame_seq")
	private int codigo;
	private String descricao;

	public TipoExame() {
		super();

	}

	public int getCodigo() {
		return codigo;
	}

	public void setCodigo(int codigo) {
		this.codigo = codigo;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + codigo;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		TipoExame other = (TipoExame) obj;
		if (codigo != other.codigo)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "TipoExame [codigo=" + codigo + ", descricao=" + descricao + "]";
	}
	
	public TipoExame clone(){
		TipoExame tipoEx = new TipoExame();
		tipoEx.setCodigo(codigo);
		tipoEx.setDescricao(descricao);
		return tipoEx;
	}

}
